<!--监控管理-->
<template>
  <div v-loading="loading" class="app-container" element-loading-text="页面正在拼命加载中">
    <iframe ref="iframe" :src="src" style="" class="iframe" @load="onLoad" />
  </div>
</template>

<script>

export default {
  components: { },

  data() {
    return {
      src: '',
      iframe: null,
      loading: true
    }
  },
  watch: {
    $route(to, from) {
      this.loadSrc()
    }
  },

  created() {
    this.iframe = this.$refs['iframe']
    this.loadSrc()
  },
  methods: {
    onLoad() {
      this.loading = false
    },
    loadSrc() {
      var remoteUrl = this.$route.meta.remoteUrl
      if (this.T.checkStr(remoteUrl, 'URL')) {
        this.src = remoteUrl
      } else {
        this.src = (process.env.NODE_ENV === 'development' ? process.env.VUE_APP_BASE_API : window.g.baseURL) + remoteUrl
      }
    },
    async reqestHttp(code) {
      try {
        const response = await this.$store.dispatch('getSystemByCode', code)
        if (response.description) {
          this.$modal.msgSuccess(response.description)
        }
        this.src = response.basePath
      } catch (_) {
        console.log()
      }
    }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

.app-container {
  padding: 0px;
  .iframe{
    width:100%;
    height:100%;
    border:none;
    .footer{
        display: none;
    }
  }
}
</style>
